import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    phone: '',//用户手机
    // phone: '13288815075',//游客
    // phone: '13555555554',//职工
    // openId: 'o6B1iv_pa8szpAsMaS6_eBH3AUsY',
    openId: '',
    roleType: '',//teacher/parent
    course: null,
    isBind: null,//是否已绑定
    submitOrderId: '',//订单提交id
    isAllSee:'',//课程可见区域
    orderDetail: {},//订单详情--订单信息
    campusList: [],//职工校区列表
    campusID: '',//职工--选中校区id
    editStuOrderId: '',
    teacherName: '',//职工姓名

    saleIndex: 'all'//职工课程、订单页面tab索引
  },
  mutations: {
    setPhone(state, data) {
      state.phone = data
    },
    setOpenId(state, data) {
      state.openId = data
    },
    setRoleType(state, data) {
      state.roleType = data
    },
    setCourse(state, data) {
      state.course = data
    },
    setIsBind(state, data) {
      state.isBind = data
    },
    delCourse(state) {
      state.course = null
    },
    setSubmitOrderId(state, data) {
      state.submitOrderId = data
    },
    setOrderDetail(state, data) {
      state.orderDetail = data
    },
    setCampusList(state, data) {
      state.campusList = data
    },
    setCampusID(state, data) {
      state.campusID = data
    },
    setEditStuOrderId(state, data) {
      state.editStuOrderId = data
    },
    setTeacherName(state, data) {
      state.teacherName = data
    },
    setSaleIndex(state,data){
      state.saleIndex = data
    },
    setAllSee(state,data){
      state.isAllSee = data
    }
  },
  getters: {
    getPhone(state) {
      return state.phone
    },
    getOpenId(state) {
      return state.openId
    },
    getRoleType(state) {
      return state.roleType
    },
    getCourse(state) {
      return state.course
    },
    getIsBind(state) {
      return state.isBind
    },
    getSubmitOrderId(state) {
      return state.submitOrderId
    },
    getOrderDetail(state) {
      return state.orderDetail
    },
    getCampusList(state) {
      return state.campusList
    },
    getCampusID(state) {
      return state.campusID
    },
    getEditStuOrderId(state) {
      return state.editStuOrderId
    },
    getTeacherName(state) {
      return state.teacherName
    },
    getSaleIndex(state){
      return state.saleIndex
    },
    getAllSee(state){
      return state.isAllSee
    }
  }
  // actions: {
  // },
  // modules: {
  // }
})
